import 'package:flutter/material.dart';
import 'package:tender_flutter/constant/resource_path.dart';
import 'package:tender_flutter/router/router.dart';
import 'package:tender_flutter/router/router_map.gr.dart';
import 'package:tender_flutter/widgets/splash_animation_button.dart';

class SplashAnimationPage extends StatefulWidget {
  //设置一个标题
  SplashAnimationButton btn = new SplashAnimationButton(
    title: '立即开启',
    onEnterAppCallback: () {
      LRouter.navigator.popAndPush(Routes.mainHomePage);
    },
  );

  @override
  _SplashAnimationPageState createState() => _SplashAnimationPageState();
}

class _SplashAnimationPageState extends State<SplashAnimationPage> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    //层叠
    return Stack(
      //中心对齐
      alignment: Alignment.center,
      fit: StackFit.expand,
      children: <Widget>[
        new Image.asset(RPath.imgPath + "guid_third.png", fit: BoxFit.cover),
        Positioned(
            //设置一个位置,距离底部60
            bottom: 60,
            child: widget.btn)
      ],
    );
  }
}
